package Document::Page;
use Moose;

has 'body' => ( is => 'rw', isa => 'Str', default => sub {''} );

sub create {
	my $self = shift;
	$self->open_page;
	inner();
	$self->close_page;
}

sub append_body {
	my ( $self, $appendage ) = @_;
	$self->body( $self->body . $appendage );
}

sub open_page { (shift)->append_body('<page>') }
sub close_page { (shift)->append_body('</page>') }

__PACKAGE__->meta->make_immutable;